<%@ page language="java"
         contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"
         import="java.util.Map"
         import="com.shxt.hotel.background.User"
%>
<%
    if(session.getAttribute("id") == null){
        response.sendRedirect("../login.jsp");
    }else{
        request.setCharacterEncoding("UTF-8");
        Map<String, String[]> paraMap = request.getParameterMap();
        
        User userManager = new User();
        Map<String, Object> user = userManager.getUserInfo(Integer.parseInt((String)paraMap.get("id")[0]));
        
        if(paraMap.get("old_password")[0].equals(user.get("password")) == false){
            response.sendRedirect("../user_edit.jsp?rslt=0");
        }
        
        int row = userManager.edit(paraMap);
        
        response.sendRedirect("../user_profiles.jsp");
    }
%>